The data used in this section of the assignment is from the United Nations, 2022, and can be found at World population prospects - population division. It contains Population, Fertility, Mortality and Migration estimates for 237 countries and/or areas from 1950 to 2021. Only the following selected variables listed in 1.1 have been used in this section of the assignment.
Note: the original data set contained population values in January and July. Only January data has been chosen the same analysis could be completed with July data but was not done in this assignment.
# create list of variables
names_data<-(names(pop1))
# create list of data types
data_type = c("Categorical","Categorical","Numerical","Numerical")
# create list of detailed information
further_information = c("Contains the following categories: World, Africa, Asia, Europe, Latin America and the Caribbean, Northern America, and Oceania.", "Contains the following information: World and Region","Contains years from 1950 to 2021", "Contains the population number in Thousands as of Janurary")
#join datasets together
names_data_final<-cbind(names_data,data_type,further_information)
# table of variable information, including column names and capition for table
kable(names_data_final,caption = "Variable Information", col.names = c('Names','Data Type','Further Information')) %>%
kable_styling()
| Names | Data Type | Further Information |
|---|---|---|
| Region, subregion, country or area * | Categorical | Contains the following categories: World, Africa, Asia, Europe, Latin America and the Caribbean, Northern America, and Oceania. |
| Type | Categorical | Contains the following information: World and Region |
| Year | Numerical | Contains years from 1950 to 2021 |
| Total Population, as of 1 January (thousands) | Numerical | Contains the population number in Thousands as of Janurary |
This filtered data set contains 4 variables. An outline of the variable types and information is presented above in Table 1.1. There are 504 observations in this filtered data set.
Table 1.2 shows the January population (in thousands) for the entire World and the regions in 1950 and 2021. It than presents the relative population change between these two years as a percentage.
relative_diff<-filter(pop1,Year %in% c(1950,2021)) %>%
pivot_wider(names_from = Year,values_from = 'Total Population, as of 1 January (thousands)') %>%
mutate('Relative Difference (%)'= ((`2021`-`1950`)/`1950`)*100)
kable(relative_diff,caption = "Relative Difference of the World and Region poulations from 1950 to 2021", digits = 0) %>%
kable_styling()
| Region, subregion, country or area * | Type | 1950 | 2021 | Relative Difference (%) |
|---|---|---|---|---|
| WORLD | World | 2477675 | 7876932 | 218 |
| AFRICA | Region | 225120 | 1377285 | 512 |
| ASIA | Region | 1365953 | 4680790 | 243 |
| EUROPE | Region | 547304 | 745853 | 36 |
| LATIN AMERICA AND THE CARIBBEAN | Region | 166137 | 654148 | 294 |
| NORTHERN AMERICA | Region | 160754 | 374641 | 133 |
| OCEANIA | Region | 12406 | 44215 | 256 |
In Table 1.2 it is observed that the Worlds Relative Population Change between 1950 and 2021 is 218%, which means the population has more than doubled in the last 70 years. The table also indicates that the region with the greatest increase in population is Africa. There has been a Relative Population Change of 512% in Africa, meanwhile the region with the lowest increase is Europe with only a 36% increase. While not explored in this assignment, further research could be undertaken to unpack the wealth of people living in these regions, as this may gain insight in the resource support required in these regions.
Figure 1.1 shows the World population from 1950 to 2021. In blue is the population values at each year, while in orange is the linear line of best fit which matches these values.
# get world data only
world<-filter(pop1, Type == 'World')
# change column names
colnames(world)[4] = "Population"
# graph a scatter graph
p<-ggplot(world,aes(x=Year, y=Population))+geom_point(color="#2375b3")+
# add line of best fit
geom_smooth(method = 'lm', se = FALSE,color = "#b36123")+
# show axis line clearly
theme(axis.line = element_line(linetype = 'solid'))+
# change y-axis label
labs(y="World Population Values in January (measured in thousands)")+
# change scale numbers from scientific to numeric
scale_y_continuous(labels = label_number())
p
Figure 1.1: The World Population in January (measured in thousands) from 1950 to 2021
From Figure 1.1 it is observed that the World Population has steadily increased over time from 1950 to 2021. This increase appears to be relatively linear, with the population values being slightly above the line of best fit in the 1950s and from 2010 on wards, this does indicate that rate of increase was slightly faster during these decades.
Figure 1.2 shows the population numbers in thousands in the regions from January 1950 to January 2021. All regions have the population values shown and a line of best fit for their values.
# get world data only
region<-filter(pop1, Type == 'Region')
# change column names
colnames(region)[4] = "Population"
colnames(region)[1] = "Region"
# graph a scatter graph
p<-ggplot(region,aes(x=Year, y=Population, color= Region))+geom_point()+
# add line of best fit
geom_smooth(method = 'lm', se = FALSE)+
# show axis line clearly
theme(axis.line = element_line(linetype = 'solid'))+
# change y-axis label
labs(y="Region Population Values in January (measured in thousands)")+
# change scale numbers from scientific to numeric
scale_y_continuous(labels = label_number())+
facet_wrap(~Region, scales ="free_y",ncol=2)
# add hover over for further information
pp<-ggplotly(p) %>%
# change position of legend
layout(legend=list(orientation='h'))
pp
Figure 1.2: The Region Populations in January (measured in thousands) from 1950 to 2021
Figure 1.2 graphs the regions on separate axes due to the large variation in populations sizes (these values can be seen in Table 1.2 for comparison). Note: the y-axis has different scales as a result of this.
An increase in population across all regions is observed in Figure 1.2, however the following further observations are also seen:
All of the above observations a made by visually comparing the individual regions to their linear regression lines further analysis of the type of regression was not conducted in this assignment to confirm the exact type of regression.
United Nations. (2022). World population prospects - population division. https://population.un.org/wpp/